<div class="box-body">
    <form class="layui-form" action="{:url('/cha/channel/save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">承运商	</label>
            <div class="layui-input-block">
                <select name="carrier_id">
                    <option value="">请选择</option>
                    {foreach $carrier as $c}
                    <option {if isset($channel) && $c.carrier_id==$channel.carrier_id}selected{/if} value="{$c.carrier_id}">{$c.carrier_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">渠道名称</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="渠道名称"  name="channel_name" {if isset($channel)}value="{$channel.channel_name}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">渠道编号</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="例：渠道商编号/运输方式"  name="channel_code" {if isset($channel)}value="{$channel.channel_code}"{/if} {if isset($channel) && !empty($channel.channel_code)}disabled{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">物流编号</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="例：51track物流商编号" name="track_code" {if isset($channel)}value="{$channel.track_code}"{/if} {if isset($channel) && !empty($channel.track_code)}disabled{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">渠道类型</label>
            <div class="layui-input-block">
                <select name="channel_type">
                    <option value="">请选择</option>
                    {foreach $channel_type as $k=>$c}
                    <option {if isset($channel) && $c==$channel.channel_type}selected{/if} value="{$k}">{$c}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否可追踪</label>
            <div class="layui-input-block">
                <select name="is_track">
                    {foreach $is_track as $k=>$c}
                    <option {if isset($channel) && $c==$channel.is_track}selected{/if} value="{$k}">{$c}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">追踪号获取方式</label>
            <div class="layui-input-block">
                <select name="track_type">
                    {foreach $track_type as $k=>$c}
                    <option {if isset($channel) && $c==$channel.track_type}selected{/if} value="{$k}">{$c}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">面单获取方式</label>
            <div class="layui-input-block">
                <select name="label_type">
                    {foreach $label_type as $k=>$c}
                    <option {if isset($channel) && $c==$channel.label_type}selected{/if} value="{$k}">{$c}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">面单宽(mm)</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="默认(100mm)"  name="label_width" {if isset($channel)}value="{$channel.label_width}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">面单高(mm)</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="默认(100mm)"  name="label_height" {if isset($channel)}value="{$channel.label_height}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">起重(g)</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="起重(g)"  name="default_weight" {if isset($channel)}value="{$channel.default_weight}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">折扣(%)</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="折扣"  name="default_discount" {if isset($channel)}value="{$channel.default_discount|default=100}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">回邮地址</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="回邮地址"  name="return_address" {if isset($channel)}value="{$channel.return_address}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">特许码</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="特许码"  name="special_code" {if isset($channel)}value="{$channel.special_code}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分练码</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="分练码"  name="part_code" {if isset($channel)}value="{$channel.part_code}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">单日最大发货量</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="单日最大发货量,如果为0不限制"  name="day_max_shipping" {if isset($channel)}value="{$channel.day_max_shipping|default=0}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="排序"  name="sort" {if isset($channel)}value="{$channel.sort}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备注"  name="remark" {if isset($channel)}value="{$channel.remark}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" value="1" {if !isset($channel) || (isset($channel) && $channel.status)}checked{/if} lay-skin="switch">
            </div>
        </div>
        {if isset($channel)}
        <input type="hidden" name="channel_id" value="{$channel.channel_id}"/>
        {/if}
    </form>
</div>